package com.spar.openprojects.shared.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.spar.openprojects.shared.BusinessPartner;
import com.spar.openprojects.shared.OrderExcel;
import com.spar.openprojects.shared.Project;
import com.sql.database.IRowMapper;

public class OrderExcelRowMapper implements IRowMapper {

	@Override
	public OrderExcel mapRow(ResultSet rs) throws SQLException {
		OrderExcel orderExcel = new OrderExcel();

		Project project = new Project();
		ProjectRowMapper projectRowMapper = new ProjectRowMapper();
		project = projectRowMapper.mapRow(rs);
		orderExcel.setProject(project);

		BusinessPartner businessPartner = new BusinessPartner();
		BusinessPartnerRowMapper businessPartnerRowMapper = new BusinessPartnerRowMapper();
		businessPartner = businessPartnerRowMapper.mapRow(rs);
		orderExcel.setBusinessPartner(businessPartner);

		return orderExcel;
	}

}
